export function request(url, method = "GET", body = {}, headers = {}) {
    const option = {
        method,
        headers: Object.assign({ "Content-Type": "application/json" }, headers)
    }
    if (method === "POST") {
        option.body = JSON.stringify(body)
    }
    return fetch(url, option).then(response => {
        return response.json()
    })
}
